home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 2.0 KB | 64 lines | [TEXT/GEOL] |
- Item 5178591 19-April-90 22:49PDT
-
- From: ANIMATRIXDEV Animatrix, Steven Marcus,PRT
-
- To: MACAPP.TECH$ MacApp Technical
-
- Sub: Re - slow TP3
-
-
-
- In Quit Command Bugs from CFI of 4-18-90:
- > Everything runs ok [with Think Pascal], despite the extreme slowness at
- executing my code...
-
-
- I too have found that my code slows to a crawl when running in the THINK Pascal
- environment. But at least for my situation I have found a fix:
-
- My application tends to allocate a large amount of objects and large handles of
- permanent data. There is a low level routine in
- 'MacApp Source:UMacAppUtilities.p' that gets called every time you use a MacApp
- routine to allocate a handle. It is used to clear/init the contents of all
- handles. Think Pascal compiles extra code in all the procedures when you run in
- its environment and this causes this heavily used routine to become real slow.
- The solution was to turn off the extra debug code in this single routine.
-
- {$Push} <-----
- {$D-} <----- I added these
- procedure BlockSet (destPtr: Ptr; byteCount: longint; setVal: univ
- SignedByte);
-
- { ??? should be improved to do longword setting. }
-
- var
- endPtr: Ptr;
-
- begin
- destPtr := Ptr(StripLong(destPtr));
- endPtr := Ptr(Ord(destPtr) + byteCount);
- while Ord(destPtr) < Ord(endPtr) do
- begin
- destPtr^ := setVal;
- destPtr := Ptr(Ord(destPtr) + 1);
- end;
- end;
- {$Pop} <-----
-
-
- This routine should probably be written in asm, but for now things run at an
- acceptable debug speed with this change. Note that this means that you will not
- be able to set breakpoints in this routine nor will you be able to step into
- it.
-
- Also I do not know whether this little patch is officially sanctioned etc...
- Also, RUMOR has it that you should not mix code that has debug turned on with
- code that has debug turned off when using failure handlers. In general I never
- turn debug off, except in this ONE case.
-
-
- Anything for improved turnaround time,
- Steven Marcus@AnimatrixDev
-
-
-